package com.gpagers.kit.lucene.util;

/**
 * 基于文件系统搜索出的结果
 * @author van
 * @time 2014年9月10日 下午5:24:08
 */
public class ResultEntity {
	/**
	 * 文件名
	 */
	private String name;
	/**
	 * 文件内容
	 */
	private String content;
	/**
	 * 文件大小
	 */
	private String size;
	/**
	 * 文件路径
	 */
	private String path;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getSize() {
		return size;
	}
	public void setSize(String size) {
		this.size = size;
	}
	public String getPath() {
		return path;
	}
	public void setPath(String path) {
		this.path = path;
	}
	
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ( ( content == null ) ? 0 : content.hashCode() );
		result = prime * result + ( ( name == null ) ? 0 : name.hashCode() );
		result = prime * result + ( ( path == null ) ? 0 : path.hashCode() );
		result = prime * result + ( ( size == null ) ? 0 : size.hashCode() );
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ResultEntity other = (ResultEntity) obj;
		if (content == null) {
			if (other.content != null)
				return false;
		} else if (!content.equals(other.content))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (path == null) {
			if (other.path != null)
				return false;
		} else if (!path.equals(other.path))
			return false;
		if (size == null) {
			if (other.size != null)
				return false;
		} else if (!size.equals(other.size))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "ResultEntity [name=" + name + ", content=" + content + ", size=" + size + "字节, path=" + path + "]\r\n";
	}
	
}
